package com.lxinet.jeesns.utils;

import java.util.Locale;
import java.util.ResourceBundle;

/**
 * Created by lzs on 2017/4/3.
 */
public class ResourceBundleReader {
    public final static Object initLock = new Object();

    private final static String PROPERTIES_FILE_NAME = "property";

    private static ResourceBundle bundle = null;

    static {
        try {
            if (bundle == null) {
                synchronized (initLock) {
                    if (bundle == null)
                        bundle = ResourceBundle.getBundle(PROPERTIES_FILE_NAME, Locale.CHINA);
                }
            }
        } catch (Exception e) {
            System.out.println("读取资源文件property_zh.properties失败!");
        }
    }

    public static ResourceBundle getBundle() {
        return bundle;
    }

    public static void setBundle(ResourceBundle bundle) {
        bundle = bundle;
    }

}
